<template>
  <div id="nav">
    <router-link class="nav-item" to="/goods">
      点菜
      <i class="line"></i>
    </router-link>

    <router-link class="nav-item" to="/ratings">
      评价(32213)
      <i class="line"></i>
    </router-link>

    <router-link class="nav-item" to="/seller">
      商家
      <i class="line"></i>
    </router-link>
  </div>
</template>
<script>
export default {};
</script>
<style scope>
/* 这里是自适应的布局 */
#nav {
  display: flex;
  width: 100%;
  height: 40px;
  line-height: 40px;
}
.nav-item {
  flex: 1;
  text-align: center;
  font-size: 13px;
  text-decoration: none;
  color: #666;
  border-bottom: 1px solid #ccc;
}
/* vue给的样式 active点击的时候回变颜色 ，但是要去router配置 linkActiveClass:active */
#nav .active {
  color: #ffbb22;
  position: relative;
}
#nav .active .line {
  display: inline-block;
  width: 20px;
  height: 2px;
  background-color: #ffbb22;
  position: absolute;
  left: 50%;
  bottom: 0;
  margin-left: -10px;
}
</style>
